package cn.iocoder.yudao.module.wms.service.rdrecord11.listener;

import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceStatusEvent;
import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceStatusEventListener;
import cn.iocoder.yudao.module.wms.service.rdrecord11.Rdrecord11Service;
import cn.iocoder.yudao.module.wms.service.rdrecord11.Rdrecord11ServiceImpl;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 材料出库监听器
 *
 * @author 芋道源码
 */
@Component
public class Rdrecord11StatusListener extends BpmProcessInstanceStatusEventListener {
    @Resource
    private Rdrecord11Service rdrecord11Service;

    @Override
    protected String getProcessDefinitionKey() {
        return Rdrecord11ServiceImpl.PROCESS_KEY;
    }

    @Override
    protected void onEvent(BpmProcessInstanceStatusEvent event) {
        rdrecord11Service.updateRdrecord11Status(Long.valueOf(event.getBusinessKey()),event.getStatus());
        /*if (event.getStatus().equals(BpmTaskStatusEnum.APPROVE.getStatus())) {
            //todo 对子表进行业务处理
            rdrecord11Service.businessProcessing(Long.valueOf(event.getBusinessKey()));
        }*/
    }
}
